<div id="mainContent">
		<div class="content">
		<a href="index.php?control=message&action=create"><input type="button" name="creerMessage" value="Nouveau message"/></a>
			<h3>MES MESSAGES :</h3>
			<div class="messages">
			<?php foreach($params['messagesprives'] as $messagesprives) {
						if($params['user']->getId()==$messagesprives->getSenderId()) {
						 	$other_id = $messagesprives->getReceiverId();
						 	$other_name = $messagesprives->getReceiverName();
						}
						else {
							$other_id = $messagesprives->getSenderId();
							$other_name = $messagesprives->getSenderName();
						}?>
			
				<div class="messagePrive" <?php if($messagesprives->estLu()==0) echo 'state="unread"'; ?>>
					
					<table>
						
						<tr>
							
							<td class="pic"><img src="photos/<?php echo (file_exists("photos/".$other_id.".jpg")) ? $other_id.".jpg" : "noimage.png";?>" alt=""/></td>
							<td class="contenu">
							<a href="index.php?control=message&action=view&args[]=<?php echo $other_id; ?>#end">
								<h4><?php echo $other_name['PSEUDO']; ?></h4>
								<p>
									<?php echo $messagesprives->getContenu(); ?>
								</p>
								<span class="dateHeure">le <?php echo $messagesprives->getDateMessage(); ?></span>
							</a>
							</td>
							
							<td class="icons">
								<form name="ACTIONMESSAGE" method="post" action="index.php?control=message&action=view">
									<input type="hidden" name="OTHERID" value="<?php echo $other_id; ?>"/>
									
									<input type="submit" name="DELETEACTION" value="Supprimer" class="DELETEACTION"/>
								</form>
							</td>
						</tr>
						
					</table>
					
				</div>
			
			<?php } ?>
			
			</div>
		</div>
</div>